package com.jingogo.service.impl;

import com.jingogo.entity.Role;
import com.jingogo.mapper.RoleMapper;
import com.jingogo.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;

    @Override
    public void addUser(String username, String password, String role) {
        // TODO: 新增用户并分配角色，需调用用户相关mapper
        throw new UnsupportedOperationException("请实现用户注册与角色分配逻辑");
    }

    @Override
    public void assignRole(Long userId, String role) {
        // TODO: 分配角色，需调用用户角色相关mapper
        throw new UnsupportedOperationException("请实现用户角色分配逻辑");
    }

    @Override
    public List<Role> listRoles() {
        return roleMapper.selectAll();
    }
} 